<template>
  <div>
    <el-descriptions ref="ruleFormRef" :column="2" direction="vertical">
      <el-descriptions-item width="50%" :label="titles.systemId">
        {{ isNullOrEmpty( deviceinfo?.systematicName ) }}
      </el-descriptions-item>
      <el-descriptions-item width="50%" :label="titles.status">
        <el-tag :type="deviceinfo?.status === 1 ? 'success' : 'danger'">
          {{ isNullOrEmpty( STRATEGYSTATUSTEXT[deviceinfo?.status]?.label ) }}
        </el-tag>

      </el-descriptions-item>
      <el-descriptions-item width="50%" :label="titles.positionInfo">
        {{ isNullOrEmpty( deviceinfo?.position == 1 ? "室内" : "室外" ) }}
      </el-descriptions-item>
      <el-descriptions-item width="50%" label="位置描述">
        {{ isNullOrEmpty( deviceinfo?.place ) }}
      </el-descriptions-item>
      <el-descriptions-item width="50%" :label="titles.gatewaySN">
        {{isNullOrEmpty(deviceinfo?.gatewaySN)}}
      </el-descriptions-item>
      <el-descriptions-item width="50%" :label="titles.productInfo">
        {{ isNullOrEmpty( deviceinfo?.productName ) }}
      </el-descriptions-item>
      <el-descriptions-item width="50%" :label="titles.productId">
        {{ isNullOrEmpty( deviceinfo?.projectName ) }}
      </el-descriptions-item>
      <el-descriptions-item width="50%" :label="titles.flowCardInfo">
        {{ isNullOrEmpty( deviceinfo?.flowcardNum ) }}
      </el-descriptions-item>
      <el-descriptions-item width="50%" :label="titles.deviceSN">
        {{ isNullOrEmpty( deviceinfo?.deviceId ) }}
      </el-descriptions-item>
      <el-descriptions-item width="50%" label="通信频率">
        {{ isNullOrEmpty( deviceinfo?.rate ) }}
      </el-descriptions-item>
      <el-descriptions-item width="50%" :label="titles.remark">
        {{ isNullOrEmpty( deviceinfo?.remark ) }}
      </el-descriptions-item>
    </el-descriptions>
  </div>
</template>
<script setup lang="ts">
import { ref, reactive, onMounted } from "vue";
import { STRATEGYSTATUSTEXT } from "@/constant/device-mangenment"
import { isNullOrEmpty } from "@/utils/functions"
import { getDeviceInfo } from "@/api/operate/device-management";
const titles = {
  deviceSN: "设备序列号", // deviceName
  productId: "所属项目", // productId
  prodcutName: "设备类型", // prodcutName
  connectStatus: "通讯状态", // connectStatus
  systemId: "所属系统", // systemId
  systemName: "系统名称", // systemName
  status: "是否启用", // status
  gatewaySN: "所属网关", // gatewaySN
  positionInfo: "位置类型",
  productInfo: "产品类型",
  flowCardInfo: "流量卡",
  remark: "备注"
};
const props = defineProps({
  deviceId: {
    type: String,
    default: ""
  },
  deviceinfo: {
    type: Object,
    default: () => ({})
  }
});
const isLoading = ref(true);
onMounted(() => {

});

</script>
